public class FCFS extends SchedulingAlgorithm {

	int arrivalTime = 0;
	int currentIndex = 0;
	Process runningProcess = null;
	
	public FCFS() {
		
	}

	
	public void RunAReadyProcessForTick() {
		runningProcess = readyQueueRef.get(currentIndex);
		// run the process for one tick if it's not in IO or if it's not finished
		if (!runningProcess.InIO() && !runningProcess.IsFinished()) {
			runningProcess.RunForOneTick();
		}
		else if (runningProcess.InIO()) {
			runningProcess = readyQueueRef.get(++currentIndex); // shouldn't be here
		}
		
		if (currentIndex == readyQueueRef.size()) {
			currentIndex = 0;
		}
	}
	
	public void idle() {
		
	}
}
